package com.imay.live.view;

import android.content.Context;
import android.graphics.Canvas;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by liangzhenxiong on 2017/04/10 0010.
 */

public class RadioCenterButton extends ImageView {

    int checkid;
    int uncheckid;

    public void setDrawble(int checkid, int uncheckid) {
        this.checkid = checkid;
        this.uncheckid = uncheckid;
        uncheck();
        setScaleType(ScaleType.CENTER_INSIDE);
    }

    public void check() {
        setImageResource(checkid);
    }

    public void uncheck() {
        setImageResource(uncheckid);
    }

    public RadioCenterButton(Context context) {
        super(context);
        init();
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public RadioCenterButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init();
    }

    public RadioCenterButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public RadioCenterButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    void init() {

    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }

}
